package com.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import java.net.http.HttpRequest;

@Controller
public class UploadController {
    @RequestMapping(value = "/upload",produces = "text/html;charset=utf-8")
    public String upload(MultipartFile img, String name, MultipartHttpServletRequest request){
        System.out.println("name"+name);
        String contentType=img.getContentType();
        System.out.println(contentType);

        System.out.println(img.getName());
        System.out.println(img.getOriginalFilename());
        System.out.println(img.getSize());
        return "上传成功";
    }

}
